package com.jhcee.jhgk.inform.utils;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description:
 * @Author: lemon_xzp
 * @Date: 2021/8/29 13:30
 */
@Slf4j
public class WechatUtil {

    private WechatUtil(){

    }

    private static final String getToken = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET";

    private static final String corpid = "wwedf21b5a507e7a66";
    private static final String secret = "IEKSqSNW8YN3v1jVyIiSIH2bdNczWOVagFr95ntHy40";

    public static void updateToken() {
        String tokenUri = getToken.replace("ID",corpid).replace("SECRET",secret);
        String result = HttpUtil.get(tokenUri);
        JSONObject jsonObject = JSONObject.parseObject(result);
        log.info(result);
    }
}
